.class public Lcom/teewoo/app/bus/ui/adapter/LineHistoryAdapter;
.super Landroid/widget/BaseAdapter;
.source "LineHistoryAdapter.java"


# instance fields
.field private inflater:Landroid/view/LayoutInflater;

.field private list:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Lcom/teewoo/app/bus/model/history/LineHistory;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method public constructor <init>(Landroid/content/Context;Ljava/util/List;)V
    .locals 1
    .parameter "ctx"
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Context;",
            "Ljava/util/List",
            "<",
            "Lcom/teewoo/app/bus/model/history/LineHistory;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 26
    .local p2, list:Ljava/util/List;,"Ljava/util/List<Lcom/teewoo/app/bus/model/history/LineHistory;>;"
    invoke-direct {p0}, Landroid/widget/BaseAdapter;-><init>()V

    .line 27
    invoke-static {p1}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v0

    iput-object v0, p0, Lcom/teewoo/app/bus/ui/adapter/LineHistoryAdapter;->inflater:Landroid/view/LayoutInflater;

    .line 28
    iput-object p2, p0, Lcom/teewoo/app/bus/ui/adapter/LineHistoryAdapter;->list:Ljava/util/List;

    .line 29
    return-void
.end method


# virtual methods
.method public getCount()I
    .locals 1

    .prologue
    .line 32
    iget-object v0, p0, Lcom/teewoo/app/bus/ui/adapter/LineHistoryAdapter;->list:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    return v0
.end method

.method public getItem(I)Ljava/lang/Object;
    .locals 1
    .parameter "position"

    .prologue
    .line 37
    iget-object v0, p0, Lcom/teewoo/app/bus/ui/adapter/LineHistoryAdapter;->list:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    return-object v0
.end method

.method public getItemId(I)J
    .locals 2
    .parameter "position"

    .prologue
    .line 42
    iget-object v0, p0, Lcom/teewoo/app/bus/ui/adapter/LineHistoryAdapter;->list:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object p0

    .end local p0
    check-cast p0, Lcom/teewoo/app/bus/model/history/LineHistory;

    invoke-virtual {p0}, Lcom/teewoo/app/bus/model/history/LineHistory;->getId()Ljava/lang/Integer;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I

    move-result v0

    int-to-long v0, v0

    return-wide v0
.end method

.method public getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 6
    .parameter "position"
    .parameter "v"
    .parameter "parent"

    .prologue
    .line 47
    iget-object v3, p0, Lcom/teewoo/app/bus/ui/adapter/LineHistoryAdapter;->inflater:Landroid/view/LayoutInflater;

    const v4, 0x7f030007

    const/4 v5, 0x0

    invoke-virtual {v3, v4, v5}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object p2

    .line 48
    const/4 v3, 0x0

    invoke-virtual {p2, v3}, Landroid/view/View;->setBackgroundColor(I)V

    .line 49
    const v3, 0x7f0a0016

    invoke-virtual {p2, v3}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/TextView;

    .line 50
    .local v0, img:Landroid/widget/TextView;
    add-int/lit8 v3, p1, 0x1

    invoke-static {v3}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v0, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 51
    const v3, 0x7f0a0018

    invoke-virtual {p2, v3}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/TextView;

    .line 52
    .local v1, lineName:Landroid/widget/TextView;
    iget-object v3, p0, Lcom/teewoo/app/bus/ui/adapter/LineHistoryAdapter;->list:Ljava/util/List;

    invoke-interface {v3, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lcom/teewoo/app/bus/model/history/LineHistory;

    invoke-virtual {v3}, Lcom/teewoo/app/bus/model/history/LineHistory;->getKeyWord()Ljava/lang/String;

    move-result-object v3

    if-nez v3, :cond_0

    const-string v3, ""

    :goto_0
    invoke-virtual {v1, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 53
    const v3, 0x7f0a0019

    invoke-virtual {p2, v3}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/TextView;

    .line 54
    .local v2, searchTime:Landroid/widget/TextView;
    iget-object v3, p0, Lcom/teewoo/app/bus/ui/adapter/LineHistoryAdapter;->list:Ljava/util/List;

    invoke-interface {v3, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lcom/teewoo/app/bus/model/history/LineHistory;

    invoke-virtual {v3}, Lcom/teewoo/app/bus/model/history/LineHistory;->getSearchTime()Ljava/lang/String;

    move-result-object v3

    if-nez v3, :cond_1

    const-string v3, ""

    .end local p0
    :goto_1
    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 55
    return-object p2

    .line 52
    .end local v2           #searchTime:Landroid/widget/TextView;
    .restart local p0
    :cond_0
    iget-object v3, p0, Lcom/teewoo/app/bus/ui/adapter/LineHistoryAdapter;->list:Ljava/util/List;

    invoke-interface {v3, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lcom/teewoo/app/bus/model/history/LineHistory;

    invoke-virtual {v3}, Lcom/teewoo/app/bus/model/history/LineHistory;->getKeyWord()Ljava/lang/String;

    move-result-object v3

    goto :goto_0

    .line 54
    .restart local v2       #searchTime:Landroid/widget/TextView;
    :cond_1
    iget-object v3, p0, Lcom/teewoo/app/bus/ui/adapter/LineHistoryAdapter;->list:Ljava/util/List;

    invoke-interface {v3, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object p0

    .end local p0
    check-cast p0, Lcom/teewoo/app/bus/model/history/LineHistory;

    invoke-virtual {p0}, Lcom/teewoo/app/bus/model/history/LineHistory;->getSearchTime()Ljava/lang/String;

    move-result-object v3

    goto :goto_1
.end method
